/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.model.objects;

/**
 * <p>
 * This class represents the resource options which dictate how a resource is associated with a view. It is a simple
 * JavaBean (POJO) that provides getters and setters for all private attributes and performs no argument validation in
 * the setters.
 * </p>
 * <p>
 * <strong>Thread safety:</strong> This class is mutable and not thread safe.
 * </p>
 *
 * @author saarixx, jmn
 * @version 1.0
 */
public class XREResourceOptions {

    /**
     * <p>
     * The resource's horizontal alignment when the resource is applied to a view.
     * </p>
     * <p>
     * Can be any value.
     * </p>
     * <p>
     * Has getter and setter.
     * </p>
     */
    private XREHorizontalAlignment horizontalAlign;

    /**
     * <p>
     * The resource's vertical alignment when the resource is applied to a view.
     * </p>
     * <p>
     * Can be any value.
     * </p>
     * <p>
     * Has getter and setter.
     * </p>
     */
    private XREVerticalAlignment verticalAlign;

    /**
     * <p>
     * The text's wrapping behavior when a XREText object is applied to a view.
     * </p>
     * <p>
     * Can be any value.
     * </p>
     * <p>
     * Has getter and setter.
     * </p>
     */
    private XRETextWrap textWrap;

    /**
     * <p>
     * The value indicating whether text that will be truncated when sized in its containing view should be appended
     * with ellipsis dots.
     * </p>
     * <p>
     * Can be any value.
     * </p>
     * <p>
     * Has getter and setter.
     * </p>
     */
    private XRETextTruncStyle textTruncStyle;

    /**
     * <p>
     * The value indicating how text will be stretched.
     * </p>
     * <p>
     * Can be any value.
     * </p>
     * <p>
     * Has getter and setter.
     * </p>
     */
    private XREResourceStretch stretch;

    /**
     * Represents the text starting position. Actually is array of two elements.
     * <p>
     * Can be array of doubles or array of strings. Has getter and setter.
     * <p>
     * AndroidAssembly3 new field with getter and setter.
     */
    private Object textStartPos = new double[2];

    /**
     * Represents the text stopping position. Actually is array of two elements.
     * <p>
     * Can be array of doubles or array of strings. Has getter and setter.
     * <p>
     * AndroidAssembly3 new field with getter and setter.
     */
    private Object textStopPos = new double[2];

    /**
     * Represents the index of starting character in text.
     * <p>
     * AndroidAssembly3 new field with getter and setter.
     */
    private int textStartChar;

    /**
     * Represents the index of last character in text.
     * <p>
     * AndroidAssembly3 new field with getter and setter.
     */
    private int textStopChar;

    /**
     * <p>
     * Creates new instance of {@link XREResourceOptions} class.
     * </p>
     */
    public XREResourceOptions() {
        // empty constructor
    }

    /**
     * <p>
     * Retrieves the resource's horizontal alignment when the resource is applied to a view.
     * </p>
     *
     * @return the resource's horizontal alignment when the resource is applied to a view
     */
    public XREHorizontalAlignment getHorizontalAlign() {
        return horizontalAlign;
    }

    /**
     * <p>
     * Sets the resource's horizontal alignment when the resource is applied to a view.
     * </p>
     *
     * @param horizontalAlign the resource's horizontal alignment when the resource is applied to a view
     */
    public void setHorizontalAlign(XREHorizontalAlignment horizontalAlign) {
        this.horizontalAlign = horizontalAlign;
    }

    /**
     * <p>
     * Retrieves the resource's vertical alignment when the resource is applied to a view.
     * </p>
     *
     * @return the resource's vertical alignment when the resource is applied to a view
     */
    public XREVerticalAlignment getVerticalAlign() {
        return verticalAlign;
    }

    /**
     * <p>
     * Sets the resource's vertical alignment when the resource is applied to a view.
     * </p>
     *
     * @param verticalAlign the resource's vertical alignment when the resource is applied to a view
     */
    public void setVerticalAlign(XREVerticalAlignment verticalAlign) {
        this.verticalAlign = verticalAlign;
    }

    /**
     * <p>
     * Retrieves the text's wrapping behavior when a XREText object is applied to a view.
     * </p>
     *
     * @return the text's wrapping behavior when a XREText object is applied to a view
     */
    public XRETextWrap getTextWrap() {
        return textWrap;
    }

    /**
     * <p>
     * Sets the text's wrapping behavior when a XREText object is applied to a view.
     * </p>
     *
     * @param textWrap the text's wrapping behavior when a XREText object is applied to a view
     */
    public void setTextWrap(XRETextWrap textWrap) {
        this.textWrap = textWrap;
    }

    /**
     * <p>
     * Retrieves the value indicating whether text that will be truncated when sized in its containing view should be
     * appended with ellipsis dots.
     * </p>
     *
     * @return the value indicating whether text that will be truncated when sized in its containing view should be
     * appended with ellipsis dots
     */
    public XRETextTruncStyle getTextTruncStyle() {
        return textTruncStyle;
    }

    /**
     * <p>
     * Sets the value indicating whether text that will be truncated when sized in its containing view should be
     * appended with ellipsis dots.
     * </p>
     *
     * @param textTruncStyle the value indicating whether text that will be truncated when sized in its containing view
     * should be appended with ellipsis dots
     */
    public void setTextTruncStyle(XRETextTruncStyle textTruncStyle) {
        this.textTruncStyle = textTruncStyle;
    }

    /**
     * <p>
     * Retrieves the value indicating how text will be stretched.
     * </p>
     *
     * @return the value indicating how text will be stretched
     */
    public XREResourceStretch getStretch() {
        return stretch;
    }

    /**
     * <p>
     * Sets the value indicating how text will be stretched.
     * </p>
     *
     * @param stretch the value indicating how text will be stretched
     */
    public void setStretch(XREResourceStretch stretch) {
        this.stretch = stretch;
    }

    /**
     * Gets the text starting position.
     *
     * @return the text starting position
     */
    public Object getTextStartPos() {
        return textStartPos;
    }

    /**
     * Sets the text starting position.
     *
     * @param textStartPos the text starting position
     */
    public void setTextStartPos(Object textStartPos) {
        this.textStartPos = textStartPos;
    }

    /**
     * Gets indexed value of starting text position.
     *
     * @param index the index in array
     * @return the value of array element at index position
     */
    public double getTextStartPos(int index) {
        return ((double[]) textStartPos)[index];
    }

    /**
     * Gets the text stopping position.
     *
     * @return the text stopping position
     */
    public Object getTextStopPos() {
        return textStopPos;
    }

    /**
     * Sets the text stopping position.
     *
     * @param textStopPos the text stopping position
     */
    public void setTextStopPos(Object textStopPos) {
        this.textStopPos = textStopPos;
    }

    /**
     * Gets indexed value of last text position.
     *
     * @param index the index in array
     * @return the value of array element at index position
     */
    public double getTextStopPos(int index) {
        return ((double[]) textStopPos)[index];
    }

    /**
     * Gets the index of starting character in text.
     *
     * @return the index of starting character in text
     */
    public int getTextStartChar() {
        return textStartChar;
    }

    /**
     * Sets the index of starting character in text.
     *
     * @param textStartChar the index of starting character in text
     */
    public void setTextStartChar(int textStartChar) {
        this.textStartChar = textStartChar;
    }

    /**
     * Gets the index of last character in text.
     *
     * @return the index of last character in text
     */
    public int getTextStopChar() {
        return textStopChar;
    }

    /**
     * Sets the index of last character in text.
     *
     * @param textStopChar the index of last character in text
     */
    public void setTextStopChar(int textStopChar) {
        this.textStopChar = textStopChar;
    }
}
